package health.lm.com.component_base.popup.sign;

import android.support.annotation.Nullable;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import health.lm.com.component_base.R;
import health.lm.com.component_base.helper.ImageLoaderHelper;
import health.lm.com.data.App;

/**
 * 签到adapter
 */
public class SignPopAdapter extends BaseQuickAdapter<SignPopBean, BaseViewHolder> {
    public SignPopAdapter(@Nullable List<SignPopBean> data) {
        super(R.layout.item_sign, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SignPopBean item) {
        ImageView ivStatue = helper.getView(R.id.iv_sign_icon);
        //ImageLoaderHelper.getInstance().load(mContext,);
        helper.setText(R.id.tv_day, item.getTitle())
                .setText(R.id.tv_day_give, item.getSugar());
        //.setImageResource(R.id.iv_sign_icon,item.getStatus().equals("0")? R.mipmap.sign_icon_succeessful);
        if (item.getStatus().equals("0"))
            ImageLoaderHelper.getInstance().load(mContext, App.model.getSugar_url(), ivStatue);
        else helper.setImageResource(R.id.iv_sign_icon, R.mipmap.sign_icon_succeessful);
    }
}
